package com.zyd.mappers;

import com.zyd.io.model.CountyEntity;
import com.zyd.io.model.CountyEntityExample;
import com.zyd.io.model.CountyEntityKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface CountyEntityMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @SelectProvider(type=CountyEntitySqlProvider.class, method="countByExample")
    long countByExample(CountyEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @DeleteProvider(type=CountyEntitySqlProvider.class, method="deleteByExample")
    int deleteByExample(CountyEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @Delete({
        "delete from zydzn_country",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(CountyEntityKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @Insert({
        "insert into zydzn_country (id, name, ",
        "code, citycode)",
        "values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
        "#{code,jdbcType=VARCHAR}, #{citycode,jdbcType=VARCHAR})"
    })
    int insert(CountyEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @InsertProvider(type=CountyEntitySqlProvider.class, method="insertSelective")
    int insertSelective(CountyEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @SelectProvider(type=CountyEntitySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR),
        @Result(column="citycode", property="citycode", jdbcType=JdbcType.VARCHAR)
    })
    List<CountyEntity> selectByExample(CountyEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @Select({
        "select",
        "id, name, code, citycode",
        "from zydzn_country",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR),
        @Result(column="citycode", property="citycode", jdbcType=JdbcType.VARCHAR)
    })
    CountyEntity selectByPrimaryKey(CountyEntityKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @UpdateProvider(type=CountyEntitySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CountyEntity record, @Param("example") CountyEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @UpdateProvider(type=CountyEntitySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") CountyEntity record, @Param("example") CountyEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @UpdateProvider(type=CountyEntitySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CountyEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_country
     *
     * @mbg.generated Sat Oct 27 08:26:17 CST 2018
     */
    @Update({
        "update zydzn_country",
        "set name = #{name,jdbcType=VARCHAR},",
          "code = #{code,jdbcType=VARCHAR},",
          "citycode = #{citycode,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(CountyEntity record);
}